package com.imu.purse.modules.trade.service;

import com.imu.purse.modules.trade.entity.FundEntity;
import com.imu.purse.modules.trade.entity.FundMergeDetailEntity;
import io.netty.util.internal.chmv8.ConcurrentHashMapV8;

import java.util.List;

/**
 * 
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-03-31 12:04:14
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
public interface FundService 
{
	/****
	 * 插入
	 * @param fund
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public int save(final FundEntity fund);
    
    /****
	 * 删除
	 * @param ids
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public boolean delete(final String ...ids);
    
    /****
	 * 修改
	 * @param fund
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public int update(final FundEntity fund);

	/**
	 * 更新金额
	 *
	 * @param id
	 * @param type
	 * @param money
	 * @return
	 */
	public int updateMoney(final String key, final Long userId, final FundEntity fund);
	

	public void release(final String key, final FundEntity fund);

	/****
	 * 插入或跟新
	 * @param fund
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public int saveUpdate(final FundEntity fund);
    
    /****
	 * 根据ID查询
	 * @param id
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public FundEntity findById(final Long id);
    
    /****
   	 * 分页查询
	 * @param fund
 	 * @date 2018-03-31 12:04:14
   	 * @return
   	 */
    public List<FundEntity> queryList(final FundEntity fund);
    
    public List<FundEntity> queryListOld(final FundEntity fund);
    
    /**
     * 修改用户的金额
     * @param fund
     * @return
     */
    public int upMoney(final FundEntity fund);

	/**
	 * 修改用户的金额
	 * @param fund
	 * @return
	 */
	public int upBjMoney(final FundEntity fund);
    
    /**
     * @param userId
     * @return
     */
    public FundEntity findByUserId(Long userId);


	/**
	 * 大小账号合并金额
	 * @param entity
	 * @return
	 */
	public int mergeFund(FundMergeDetailEntity entity);

	/**
	 * 获取核心钱包地址
	 * @return
	 */
	String getCoreAddress();

	/**
	 * 根据地址获取核心钱包地址
	 * @param address
	 * @return
	 */
	String getCordeByAddress(String address);

	/**
	 * 获取要更新的以太坊地址
	 * @return
	 */
	public List<FundEntity> findAdressData(final FundEntity fundEntity);

	/**
	 * 更加ID修改用户核心钱包地址
	 * @param fundEntity
	 * @return
	 */
	public int upAddressById(final FundEntity fundEntity);

	/**
	 * 根据主键ID和手机号码查询数据
	 * @param fundEntity
	 * @return
	 */
	public FundEntity findByIdAndPhone(final FundEntity fundEntity);
}
